#!/usr/bin/env node
'use strict';
var inquirer = require('inquirer');
require('shelljs/global');
require('locus');


//cd('/Users/wkc/qbox/vance');
const branchs_out = exec('git branch --no-color', {silent:true}).stdout
const branchs = branchs_out.split('\n').map(v=>v.trim().replace('* ','')).filter(v=>v.length && !v.startsWith('old'))

inquirer.prompt([
  {
    type: 'list',
    name: 'branch',
    message: 'choose branch?',
    default: "develop",
    choices: branchs,
    filter: function (val) {
      return val
    }
  }
]).then(function (branch) {
  exec('git checkout '+branch.branch)
});

// eval(locus)

